﻿<%@ Page Language="C#" MasterPageFile="~/Game/Game.Master" AutoEventWireup="true"
    CodeBehind="CreateMessage.aspx.cs" Inherits="smallDeimos.Game.CreateMessage"
    Title="Create message" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script type="text/javascript" src="../jquery-1.2.6.min.js"></script>
<script language="javascript" type="text/javascript">
// <!CDATA[

function Button2_onclick() {
var t = document.getElementById("<%= TextBox1.ClientID %>");
t.value += "[quote=][/quote]";
}

function Button3_onclick() {
var t = document.getElementById("<%= TextBox1.ClientID %>");
t.value += "[b][/b]";
}

function Button4_onclick() {
var t = document.getElementById("<%= TextBox1.ClientID %>");
t.value += "[i][/i]";
}

// ]]>
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table>
        <tr>
            <th>
                To:
            </th>
            <th>
                <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="ObjectDataSource1"
                    DataTextField="PlayerName" DataValueField="PlayerId">
                </asp:DropDownList>
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"></asp:ObjectDataSource>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:smallDeimosConnectionString %>"
                    SelectCommand="SELECT [PlayerId], [PlayerName] FROM [Players] WHERE ([PlayerId] &gt; @PlayerId)">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="1" Name="PlayerId" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </th>
            <th></th>
        </tr>
        <tr>
            <td valign="top">
                Message:
            </td>
            <td>
                <asp:TextBox ID="TextBox1" runat="server" Height="400px" TextMode="MultiLine" Width="500px"></asp:TextBox><br />
                &nbsp;</td>
            <td valign="top">BBCode:
            <table>
            <tr><td>
                <input id="Button2" type="button" value="Quote" onclick="return Button2_onclick()" /></td><td>
                    <input id="Button3" type="button" value="B" style="font-weight: bold" onclick="return Button3_onclick()" /></td><td>
                        <input id="Button4" type="button" value="I" style="font-style: italic" onclick="return Button4_onclick()" /></td><td>
                            <input id="Button5" type="button" value="U" 
                                style="text-decoration: underline" /></td></tr>
            </table>
            </td>
        </tr>
    </table>
    <asp:Button ID="Button1" runat="server" Text="Sent" OnClick="Button1_Click" />
    <asp:Label ID="statusLbl" runat="server" Text="" />
</asp:Content>
